<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        div{
            border:1px solid green;
        }
    </style>
    <script>
        function init(){
            document.getElementById("div1").addEventListener("click",()=>{
                alert("点击了div1")
            },false);
            document.getElementById("div2").addEventListener("click",(event)=>{
                alert("点击了div2")
            },false);
            document.getElementById("div3").addEventListener("click",()=>{
                alert("点击了div3")
            },false);
        }
        window.addEventListener("load",init,false);     
      </script>
</head>
<body>
    <div id="div1" style="width: 500px;height:400px;">
        <div id="div2" style="width:200px;height:200px;margin:50px">
            <div id="div3" style="width:50px;height:50px;margin:50px;cursor: pointer;">
                点
            </div>
        </div>
    </div>
</body>
</html>